<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<style>
.mws-form select {
	padding:0px;
}
</style>
<script>
jQuery(document).ready(function(){
		$('#chrcount').keyup(function(){
			var len = jQuery('#chrcount').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength').html(255-char);	
		});
	});
	
	jQuery(document).ready(function(){
		
		$('#ProductOptionId').change(function(){
			var val = $(this).attr('value');
			var dataString = 'val='+val;
				$.ajax
					({
						type: "POST",
						url: "<?php
										echo $website_url . 'admin/setups/get_option_values';
							?>",
						data: dataString,
						cache: false,
						success: function(html)
						{
						   $('#Prooption').html(html);
						}
					});
			});
			
			$('#ProductGroupattribute').change(function(){
			var val = $(this).attr('value');
			var dataString = 'val='+val;
				$.ajax
					({
						type: "POST",
						url: "<?php
									echo $website_url . 'admin/setups/get_attributes_values';
							?>",
						data: dataString,
						cache: false,
						success: function(html)
						{
						   $('#ajaxAttr').html(html);
						}
					});
					
			});
		
			
		$('#ProductCatId').change(function(){
			var val = $(this).attr('value');
			var dataString = 'cat_id='+val;
			var i=1;
			if(i==1)
			{
				$.ajax
					({
						type: "POST",
						url: "<?php echo $website_url . 'admin/setups/get_brands_values';?>",
						data: dataString,
						cache: false,
						success: function(html)
						{
						   $('#GetBrandsOnProductPage').html(html);
						    var i_1=2;
							if(i_1==2){
								$('.changeresultattr').html('&nbsp;');
								var dataString_2 = 'cat_id='+val;	
								$.ajax
									({
										type: "GET",
										url: "<?php  echo $website_url . 'admin/setups/get_attributes_cat';?>",
										data: dataString_2,
										cache: false,
										success: function(html)
										{
											$('.changeresultattr').html(html);
										}
									});
							}
						}
					});
			}
			
					
					
			});
			
			$('#UserPriceList0').click(function(){
					$('.priceoption').attr('disabled', 'disabled');
				});
			$('#UserPriceList1').click(function(){
					$('.priceoption').removeAttr('disabled');
			});	
		
		$('#chrcount2').keyup(function(){
			var len = jQuery('#chrcount2').val();
			var char = len.length;	
			if(254-char == 0){
				}
			$('#chrcountlength2').html(255-char);	
		});
		
		        var incrementVar = 0;

				jQuery('#addattr').click(function (){
							var newDate = new Date;
							var randomNum = newDate.getTime();
							var	apphtml = jQuery('.addattr').html().
							replace('<select name="data[Product][Attr][1][attribute]" class="ProductAttribute mws-textinput" id="ProductAttribute">',
							 '<select name="data[Product][Attr]['+randomNum+'][attribute]" class="ProductAttribute mws-textinput" id="ProductAttribute">').
							replace('<input name="data[Product][Attr][1][key]" value="" class="sd" type="hidden">',
							 '<input name="data[Product][Attr]['+randomNum+'][key]" value="" class="sd" type="hidden">')
							 .
							replace('<input name="data[Product][Attr][1][attr_value]" value="" class="mws-textinput" id="ProductAttrValue" type="text">',
							 '<input name="data[Product][Attr]['+randomNum+'][attr_value]" value="" class="mws-textinput" id="ProductAttrValue" type="text">');
							
							//console.log(apphtml);
							//return false;
							jQuery('.appenddiv').append("<div id='"+randomNum+"'></div> <div class='clear' style='clear:both;'></div>");
							jQuery('#'+randomNum).html(apphtml);
					});

		        jQuery('.ProductAttribute').change(function () {
				var newDate = new Date;
				var randomNum = newDate.getTime();
				var value = jQuery(this).attr('value');
				var id = $(this).parent().parent().attr('id', 'sdo'+randomNum+'3');
				var str = "";
				jQuery("select.ProductAttribute option:selected").each(function () {
				str = $(this).text();
				});
				jQuery('#sdo'+randomNum+'3 input[type="hidden"]').attr('value', str);
				 
				
				
		});	


	});
</script>

<div id="mws-container" class="clearfix">
<div class="container">
     <div class="mws-panel grid_8">
          <div class="mws-panel-header"> <span class="mws-i-24 i-list">Add Product</span> </div>
          <div class="mws-panel-body">
               <div class="mws-form-inline">
                    <?php
echo $form->create(array(
    'controller' => 'setups',
    'action' => '',
    'method' => 'post',
    'enctype' => 'multipart/form-data',
    'class' => 'mws-form'
));
?>
                    <?php
if (isset($details['Product']['id']))
    {
    $details['Product']['id'] = $details['Product']['id'];
    }
else
    {
    $details['Product']['id'] = "";
    }
echo $this->Form->input('Product.id', array(
    'type' => 'hidden',
    'value' => $details['Product']['id']
));
?>
                    <div class="mws-form-row">
                         <label>Name :</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['name']))
    {
    $details['Product']['name'] = $details['Product']['name'];
    }
else
    {
    $details['Product']['name'] = "";
    }

echo $this->Form->input('Product.name', array(
    'type' => 'text',
    'value' => $details['Product']['name'],
    'class' => 'mws-textinput',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Category:</label>
                         <div class="mws-form-item small">
                              <?php
/*if(isset($details['Product']['cat_id'])){$details['Product']['cat_id']=$details['Product']['cat_id'];}else{$details['Product']['cat_id']="";}
echo $this->Form->input('Product.cat_id', 
array('type' => 'select','options'=>$_list_categories,
'default'=>$details['Product']['cat_id'],'class'=>'mws-textinput','empty'=>false,'label' =>false)
);*/
//pr($_list_categories);
//pr($_list_categories);
//exit;
//        echo "<pre>";
//        print_r($_list_categories);
//        echo "</pre>";
//        
//        exit;
?>
                              <select id="ProductCatId" class="mws-textinput" name="data[Product][cat_id]">
                                   <?php

foreach ($_list_categories as $_list_category)
    {
      
    if (isset($_list_category['subcatecategories']) and ($_list_category['subcatecategories']))
        {
        if ($_list_category['name']):
            echo "<optgroup label=" . str_replace(" ","_", $_list_category['name']) . ">";
            foreach ($_list_category['subcatecategories'] as $_list_category_sub)
                {
					if($details['Product']['cat_id']==$_list_category_sub['Category']['id'])
					{
						$selected = "selected='selected'";
					}
					else
					{
						$selected = "";
					}
                echo "<option  ".$selected ." value=" . $_list_category_sub['Category']['id'] . ">" . $_list_category_sub['Category']['name'] . "</option>";
                }
            echo "</optgroup>";
        endif;
        }
    }
?>
                              </select>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Department:</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['dept_id']))
    {
    $details['Product']['dept_id'] = $details['Product']['dept_id'];
    }
else
    {
    $details['Product']['dept_id'] = "";
    }
echo $this->Form->input('Product.dept_id', array(
    'type' => 'select',
    'options' => $list_products,
    'default' => $details['Product']['dept_id'],
    'class' => 'mws-textinput',
    'empty' => true,
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Brand:</label>
                         <div class="mws-form-item small" id="GetBrandsOnProductPage">
                              <?php
if (isset($details['Product']['brand_id']))
    {
    $details['Product']['brand_id'] = $details['Product']['brand_id'];
    }
else
    {
    $details['Product']['brand_id'] = "";
    }
echo $this->Form->input('Product.brand_id', array(
    'type' => 'select',
    'options' => $_list_brands,
    'default' => $details['Product']['brand_id'],
    'class' => 'mws-textinput',
    'empty' => false,
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>* Meta Description :</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['meta_desc']))
    {
    $details['Product']['meta_desc'] = $details['Product']['meta_desc'];
    }
else
    {
    $details['Product']['meta_desc'] = "";
    }
echo $this->Form->input('Product.meta_desc', array(
    'type' => 'teatarea',
    'rows' => '5',
    'cols' => '44',
    'value' => $details['Product']['meta_desc'],
    'class' => 'mws-textinput',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>* Meta Keyword :</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['meta_key']))
    {
    $details['Product']['meta_key'] = $details['Product']['meta_key'];
    }
else
    {
    $details['Product']['meta_key'] = "";
    }

echo $this->Form->input('Product.meta_key', array(
    'type' => 'teatarea',
    'value' => $details['Product']['meta_key'],
    'rows' => '5',
    'cols' => '44',
    'class' => 'mws-textinput',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row" style="width:100%">
                         <label>* Description:</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['description']))
    {
    $details['Product']['description'] = $details['Product']['description'];
    }
else
    {
    $details['Product']['description'] = "";
    }

echo $this->Form->input('Product.description', array(
    'type' => 'teatarea',
    'rows' => '5',
    'cols' => '44',
    'value' => $details['Product']['description'],
    'class' => 'mws-textinput',
    'label' => false
));
?>
                              <script type="text/javascript">
			var editor = CKEDITOR.replace( 'ProductDescription' );
			CKFinder.setupCKEditor( editor, { basePath : '<?php
echo $website_url;
?>app/webroot/ckfinder' } ) ;  </script> 
                              </script> 
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Model :</label>
                         <div class="mws-form-item 	small">
                              <?php
if (isset($details['Product']['p_model']))
    {
    $details['Product']['p_model'] = $details['Product']['p_model'];
    }
else
    {
    $details['Product']['p_model'] = "";
    }

echo $this->Form->input('Product.p_model', array(
    'type' => 'text',
    'value' => $details['Product']['p_model'],
    'class' => 'mws-textinput',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Upc :</label>
                         <div class="mws-form-item 	small">
                              <?php
if (isset($details['Product']['upc']))
    {
    $details['Product']['upc'] = $details['Product']['upc'];
    }
else
    {
    $details['Product']['upc'] = "";
    }

echo $this->Form->input('Product.upc', array(
    'type' => 'text',
    'value' => $details['Product']['upc'],
    'class' => 'mws-textinput',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>MSRP :</label>
                         <div class="mws-form-item 	small">
                              <?php
if (isset($details['Product']['msrp']))
    {
    $details['Product']['msrp'] = $details['Product']['msrp'];
    }
else
    {
    $details['Product']['msrp'] = "";
    }

echo $this->Form->input('Product.msrp', array(
    'type' => 'text',
    'value' => $details['Product']['msrp'],
    'class' => 'mws-textinput',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Tax Class :</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['tax_type']))
    {
    $details['Product']['tax_type'] = $details['Product']['tax_type'];
    }
else
    {
    $details['Product']['tax_type'] = "";
    }
$options_tax = array(
    '9' => 'Taxable Goods',
    '10' => 'Downloadable Products'
);
echo $this->Form->input('Product.tax_type', array(
    'type' => 'select',
    'options' => $options_tax,
    'default' => $details['Product']['tax_type'],
    'class' => 'mws-textinput',
    'empty' => false,
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Stock:</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['stock']))
    {
    $details['Product']['stock'] = $details['Product']['stock'];
    }
else
    {
    $details['Product']['stock'] = "2";
    }
echo $this->Form->input('Product.stock', array(
    'type' => 'select',
    'options' => $list_stock_status,
    'default' => $details['Product']['stock'],
    'class' => 'mws-textinput',
    'empty' => false,
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Default Image:</label>
                         <div class="mws-form-item 	small">
                              <?php
echo $this->Form->input('Product.imgImage', array(
    'type' => 'file',
    'value' => '',
    'class' => '',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Related Images:</label>
                         <div class="mws-form-item 	small">
                              <?php
echo $this->Form->input('Product.RelatedimgImage', array(
    'type' => 'file',
    'max' => '5',
    'name' => 'data[Product][multi][]',
    'multiple' => 'multiple',
    'label' => false
));
?>
                         </div>
                    </div>
                    <?php if(isset( $details['Product']['img']) and ( $details['Product']['img'])) {?>
                    <div class="mws-form-row">
                         <label>Old Image:</label>
                         <div class="mws-form-item"> <?php echo $html->image('Product/'.$details['Product']['img'].'', array('width'=>150, 'height'=>'150')); ?> </div>
                    </div>
                    <?php 
		} 
		?>
                    <?php if(isset( $details['Product']['rel_img']) and ( $details['Product']['rel_img'])) {?>
                    <div class="mws-form-row">
                         <label>Related Images:</label>
                         <div class="mws-form-item">
                              <?php 
				 	$exp = explode(',',$details['Product']['rel_img'] );
				 	foreach( $exp as  $related_img){
				     echo $html->image('Product/'.$details['Product']['id'].'/'.str_replace(" ","",$related_img).'',
					  array('width'=>50, 'height'=>'50'));
					 //echo "<br>";
					}
				  ?>
                         </div>
                    </div>
                    <div class="clear" style=" clear:both;"></div>
                    <?php 
		} 
		?>
                    <div class="mws-form-row">
                         <label>Status Type :</label>
                         <div class="mws-form-item 	small">
                              <?php
								if (isset($details['Product']['status']))
									{
									$details['Product']['status'] = $details['Product']['status'];
									}
								else
									{
									$details['Product']['status'] = "";
									}
								$options = array(
									'1' => 'Active',
									'0' => 'Deactive'
								);
								echo $this->Form->input('Product.status', array(
									'type' => 'select',
									'options' => $options,
									'default' => $details['Product']['status'],
									'class' => 'mws-textinput',
									'empty' => false,
									'label' => false
								));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Weight:</label>
                         <div class="mws-form-item small">
                              <?php
			if (isset($details['Product']['weight']))
				{
				$details['Product']['weight'] = str_replace("lb","",$details['Product']['weight']);
				}
			else
				{
					$details['Product']['weight'] = "";
				}
			echo $this->Form->input('Product.weight', array(
					'type' => 'text',
					'value' => $details['Product']['weight'],
					'class' => 'mws-textinput',
					'style'=>'width:105px; float: left; margin-right:10px;',  
					'label' => false
			));
			?>
                              <?php
                echo $this->Form->input('Product.weight_unit', array(
                    'type' => 'select',
					'options' => array('lb'=>'lb'/*,'kg'=>'kg','gram'=>'gram','oz'=>'oz'*/),
                    'default' => '1',
                    'class' => 'mws-textinput',
                    'empty' => false,
                    'style'=>'    border: 1px solid #CCCCCC;float: left;height: 30px;width:60px;',  
                    'label' => false
                ));
            ?>
                         </div>
                    </div>
                    <!--<div class="clear" style=" clear:both;"></div>-->
                    <div class="mws-form-row">
                         <label>Listing Access  For Merchants:</label>
                         <div class="mws-form-item 	small">
                              <?php

if (isset($details['Product']['list_access']))
    {
    $details['Product']['list_access'] = $details['Product']['list_access'];
    }
else
    {
    $details['Product']['list_access'] = "";
    }
$alow_array = array(
    '1' => 'Allow',
   /* '0' => 'Not Allow'*/
);
echo $this->Form->input('Product.status', array(
    'type' => 'select',
    'options' => $alow_array,
    'default' => $details['Product']['list_access'],
    'class' => 'mws-textinput',
    'empty' => false,
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="mws-form-row">
                         <label>Dimentions:</label>
                         <div class="mws-form-item small">
                              <?php
if (isset($details['Product']['dimentions']))
    {
    $details['Product']['dimentions'] = $details['Product']['dimentions'];
    }
else
    {
    $details['Product']['dimentions'] = "";
    }

echo $this->Form->input('Product.dimentions', array(
    'type' => 'text',
    'value' => $details['Product']['dimentions'],
    'class' => 'mws-textinput',
	'placeholder'=>'L*B*H',
    'label' => false
));
?>
                         </div>
                    </div>
                    <div class="clear" style=" clear:both;"></div>
                    <div class="changeresultattr"></div>
                    <?php if(isset($Special_Specifications) and ($Special_Specifications))
				{
					echo "<div class='single_border_window'>";
				foreach($Special_Specifications as $Special_ATTRGRP)
					{
				?>
                    <div class="mws-form-row">
                         <div class="mws-form-item small">
                              <?php
								echo $this->Form->input('', array(
								'type' => 'text',
								'class' => 'mws-textinput',
								'label' => false,
								'id'=>'gb1',
								'disabled'=>'disabled',
								'value'=>$Special_ATTRGRP['AttrGroup']['name'],
								));
								?>
                              <?php
								echo $this->Form->input('Product.Groupattribute', array(
								'type' => 'hidden',
								'id'=>'gb2',
								'class' => 'mws-textinput',
								'label' => false,
								'value'=>$Special_ATTRGRP['AttrGroup']['id'],
								));
								?>
                         </div>
                    </div>
                    <div class="clear" style=" clear:both;"></div>
                    <?php 
							if(isset($Special_ATTRGRP['AttrGroup']['Attributes']) and ($Special_ATTRGRP['AttrGroup']['Attributes']))
							{
							?>
                    <div class="editable_addattr">
                         <div class="mws-form-row" style="width:100%;">
                              <div class="mws-form-item small"> <span id="editable_ajaxAttr">
                                   <?php
			foreach($Special_ATTRGRP['AttrGroup']['Attributes'] as $arrbute)
							{
								if(isset($arrbute['Specifications']) and ($arrbute['Specifications']))
								{
									foreach($arrbute['Specifications'] as $specification)
									{
										//pr($specification);
										//exit;
			
								?>
                                   <div id="ATTR<?php echo $specification['Specification']['id']; ?>">
                                        <div class="mws-form-row">
                                             <label>Selected Attribute:</label>
                                             <div class="mws-form-item small">
                                                  <input type="text" readonly="readonly" 
	value="<?php echo $specification['Specification']['key']; ?>" class="mws-textinput">
                                                  <input type="hidden" name="data[Product][Attr][<?php echo $specification['Specification']['attr_id']; ?>][id]"
     value="<?php echo $specification['Specification']['id']; ?>" style="width:100px;">
                                                  <input type="hidden" name="data[Product][Attr][<?php echo $specification['Specification']['attr_id']; ?>][attribute]"
     value="<?php echo $specification['Specification']['attr_id']; ?>" style="width:100px;">
                                                  <input type="hidden" name="data[Product][Attr][<?php echo $specification['Specification']['attr_id']; ?>][key]" value="<?php echo $specification['Specification']['key']; ?>" class="sd">
                                             </div>
                                        </div>
                                        <div class="mws-form-row">
                                             <label>Attribute Value:</label>
                                             <div class="mws-form-item small">
                                                  <div class="input text">
                                                       <input type="text" 
	name="data[Product][Attr][<?php echo $specification['Specification']['attr_id']; ?>][attr_value]"
	value="<?php echo $specification['Specification']['value']; ?>" class="mws-textinput"
	id="ProductAttrValue" style="width:306px;">
                                                  </div>
                                             </div>
                                        </div>
                                   </div>
                                   <div style="clear:both;" class="clear"></div>
                                   <?php
									}
								}
							}
							?>
                                   </span> </div>
                         </div>
                    </div>
                    <?php
							}
							?>
                    <div class='clear' style='clear:both;'></div>
                    <?php
					}
					echo "</div>";
				}
		/*else{*/
			?>
                    <div class="mws-form-row">
                         <label >Select Group Attribute:</label>
                         <div class="mws-form-item small">
                              <?php
        echo $this->Form->input('Product.Groupattribute', array(
        'type' => 'select',
        'options' => $attrGroups,
        'class' => 'ProductAttribute mws-textinput',
        'empty' => true,
        'label' => false,
		'default'=>"",
        ));
        ?>
                         </div>
                    </div>
                    <div class="clear" style=" clear:both;"></div>
                    <div class="addattr">
                         <div class="mws-form-row" style="width:100%;">
                              <div class="mws-form-item small"> <span id="ajaxAttr">
                                   <?php
				/*echo $this->Form->input('Product.attribute', array(
					'type' => 'select',
					'options' => $_list_attributes,
					'name' => 'data[Product][Attr][1][attribute]',
					'class' => 'ProductAttribute mws-textinput',
					'empty' => false,
					'label' => false
				));*/
?>
                                   <?php /*?>				<?php
                if(isset($_list_attributes) and ($_list_attributes))
				{
                    foreach($_list_attributes as $_list_attribute)
                        {
                    ?>
                                <div id="ATTR1337845210377<?php echo $_list_attribute['Attribute']['id']; ?>">
                              <div class="mws-form-row">
                                <label>Select Attribute:</label>
                                <div class="mws-form-item small">
                                   <input type="text" class="mws-textinput" value="<?php echo $_list_attribute['Attribute']['name']; ?>" readonly="readonly">
                                   <input type="hidden" style="width:100px;" value="<?php echo $_list_attribute['Attribute']['id']; ?>" name="data[Product][Attr][<?php echo $_list_attribute['Attribute']['id']; ?>][attribute]">
                                  <input type="hidden" class="sd" value="<?php echo $_list_attribute['Attribute']['name']; ?>"
                                   name="data[Product][Attr][<?php echo $_list_attribute['Attribute']['id']; ?>][key]">
                                </div>
                              </div>
                              <div class="mws-form-row">
                                <label>Attribute Value:</label>
                                <div class="mws-form-item small"> <div class="input text">
                                <?php
                                    if(isset($_list_attribute['Attribute']['required']) and ($_list_attribute['Attribute']['required']==1))
                                    {
                                        $required = 'required="required"'; 
                                    }
                                    else
                                    {
                                        $required = "";
                                    }
                                ?>
                                <input type="text" style="width:306px;" id="ProductAttrValue" class="mws-textinput" <?php echo $required; ?> value="" name="data[Product][Attr][<?php echo $_list_attribute['Attribute']['id']; ?>][attr_value]"></div> </div>
                              </div>
                            </div>
                                <div class="clear" style="clear:both;"></div>
                            <?php
                        }
				}
                    ?>
<?php */?>
                                   </span> </div>
                         </div>
                         <!--<div class="mws-form-row">
            <label>Attribute Value:</label>
            <div class="mws-form-item small"> <?php
/*echo $this->Form->input('Product.attr_value', array(
    'type' => 'text',
    'name' => 'data[Product][Attr][1][attr_value]',
    'value' => '',
    'class' => 'mws-textinput',
    'label' => false
));*/
?> </div>
          </div>--> 
                    </div>
                    <div class='clear' style='clear:both;'></div>
                    <div class="appenddiv"> </div>
                    <div class="clear" style=" clear:both;"></div>
                    <div class=""> 
                         <!--          <label style="font-weight:bold;" class="addattrNow" id="addattr">Add Options :</label>
-->
                         <label style="font-weight:bold;">Add Options :</label>
                    </div>
                    <?php /*}*/ ?>
                    <div class="addattr">
                         <div class="mws-form-row">
                              <label >Attribute:</label>
                              <div class="mws-form-item small">
                                   <?php
					echo $this->Form->input('Product.option_id', array(
						'type' => 'select',
						'options' => $list_options,
						'name' => 'data[Product][option][][option_id]',
						'default' => '4',
						'class' => 'ProductAttribute mws-textinput',
						'empty' => false,
						'label' => false
					));
?>
                              </div>
                         </div>
                         <div class="mws-form-row">
                              <label >Option Prices:</label>
                              <div class="mws-form-item small">
                                   <?php
$price_selected = array(
    '0' => 'Default Price',
    '1' => 'Add Prices'
);
$attributes     = array(
    'legend' => false,
    'default' => '1'
);
echo $this->Form->radio('PriceList', $price_selected, $attributes);
?>
                              </div>
                         </div>
                         <div class="clear" style=" clear:both;"></div>
                         <table class="list" id="option-value0" style="margin-left:20px;">
                              <thead>
                                   <tr>
                                        <td width="239" class="left">Option Value:</td>
                                        <td width="189" class="right">Quantity:</td>
                                        <td width="149" class="left">Subtract Stock:</td>
                                        <td width="164" class="right">Price:</td>
                                        <td width="223" class="right">Weight:</td>
                                        <td width="223" class="right">Weight Units:</td>
                                        <td width="242"></td>
                                   </tr>
                              </thead>
                              <tbody id="option-value-row0">
                                   <tr>
                                        <td class="left" id=""><input type="text" size="23" value="" name="data[Product][option][product_option][0][value_name]"></td>
                                        <td class="right"><input type="text" size="5" value="" name="data[Product][option][product_option][0][qty]"></td>
                                        <td class="left"><select name="data[Product][option][product_option][0][subtract_stock]">
                                                  <option selected="selected" value="1">Yes</option>
                                                  <option value="0">No</option>
                                             </select></td>
                                        <td class="right"><input type="text" size="8" value=" " class="priceoption" name="data[Product][option][product_option][0][price]"></td>
                                        <td class="right">&nbsp;
                                             <input type="text" size="10" value=" " class="priceoption" name="data[Product][option][product_option][0][weight]"></td>
                                        <td class="right">&nbsp;
                                             <input type="text" size="10" value=" " class="priceoption" name="data[Product][option][product_option][0][weight_units]"></td>
                                        <td class="left"><!-- <a class="button" onclick="$('#option-value-row0').remove();"><strong>Remove</strong></a>--></td>
                                   </tr>
                              </tbody>
                              <tfoot>
                                   <tr>
                                        <td colspan="5"></td>
                                        <td class="left"><!--<a class="button" onclick="addOptionValue('0');"><strong>Add Option Value</strong></a>--></td>
                                   </tr>
                              </tfoot>
                         </table>
                    </div>
                    <div class="mws-button-row">
                         <input type="submit" class="mws-button black" value="Submit">
                    </div>
                    </form>
               </div>
          </div>
     </div>
</div>
